<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('index');
});



//注册登录路由z
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');
//Route::get('register', 'Auth\AuthController@postRegister');
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');

//验证码
Route::get('captcha','AuthorController@captcha');


//home路由，登录后执行，回到主页z
Route::get('home',function(){
	return view('index');
});


//作者中心

Route::get('work', 'AuthorController@getWorks');
Route::get('subscribe','AuthorController@getSubscribe');
Route::get('reward','AuthorController@getReward');
Route::get('comments','AuthorController@getComments');
Route::get('authorset','AuthorController@getAuthorset');
Route::post('authorset','AuthorController@postAuthorset');

//用户中心
Route::get('shelf','ShelfController@showShelf');  //展示登录用户的书架
Route::get('addtoshelf/{nid}','ShelfController@addtoshelf');//把小说加入到书架
Route::get('remove/{sid}','ShelfController@remove');//把小说移出书架


//小说的各种路由
Route::get('noveladd','NovelController@getNoveladd');
Route::post('noveladd', 'NovelController@postNoveladd');
Route::get('girl','NovelController@girl');
Route::get('boy','NovelController@boy');
Route::get('ranking','NovelController@ranKing');
Route::get('novelset/{nid}','NovelController@getNovelset');
Route::post('novelset/{nid}','NovelController@postNovelset');


//草稿箱
Route::get('draft/{nid}','NovelController@getDraft');
Route::post('draft/{nid}','NovelController@postDraft');

//章节路由
Route::get('chapteradd/{nid}','ChapterController@getChapteradd');
Route::post('chapteradd/{nid}', 'ChapterController@postChapteradd');
Route::get('published/{nid}', 'ChapterController@published');
Route::get('chapteredit/{nid}/{chid}','ChapterController@getChapteredit');
Route::post('chapteredit/{nid}/{chid}', 'ChapterController@postChapteredit');
Route::get('chapterdel/{nid}/{chid}', 'ChapterController@getChapterdel');
Route::get('chapter-list/{nid}','ChapterController@getChapterList');

//草稿箱路由
Route::post('draftadd/{nid}', 'DraftController@draftadd');    //添加草稿
Route::get('draft/{nid}', 'DraftController@draftlist');       //草稿箱展示
Route::get('draftdel/{nid}/{drid}', 'DraftController@draftdel'); //草稿删除
Route::get('draftedit/{nid}/{drid}','DraftController@getDraftedit');  //草稿编辑
Route::post('draftedit/{nid}/{drid}', 'DraftController@postDraftedit');


//主页展示路由
Route::get('/', 'IndexController@index');

//
Route::get('homepage/{nid}', 'IndexController@getHomepage');
Route::post('homepage/{nid}', 'IndexController@postHomepage');
Route::get('chapterlist/{nid}', 'IndexController@chapterlist');  //目录展示路由

//搜索、书库
Route::get('search/{gender?}','NovelController@getSearch');



Route::get('captcha','AuthorController@captcha');

//小说阅读页
Route::get('read/{chid}', 'ChapterController@getChapter');


//手机短信验证码
Route::get('haha','IndexController@haha');

// 密码重置链接的路由...
Route::get('password/email', 'Auth\PasswordController@getEmail');
Route::post('password/email', 'Auth\PasswordController@postEmail');

// 密码重置的路由...
Route::get('password/reset/{token}', 'Auth\PasswordController@getReset');
Route::post('password/reset', 'Auth\PasswordController@postReset');


// Route::get('test', function(){
// 	return view('admin/chapter-published');
// });



Route::get('test', function(){
	return view('user/shelf');
});
